/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package utils;

/**
 *
 * @author jamie
 */
public class Matthews {

	private double tp;
	private double fp;
	private double tn;
	private double fn;

	public Matthews() {
	}

	public Matthews(double tp, double fp, double tn, double fn){

		this.tp = tp;
		this.fp = fp;
		this.tn = tn;
		this.fn = fn;
	}

	public void setFn(double fn) {
		this.fn = fn;
	}

	public void setFp(double fp) {
		this.fp = fp;
	}

	public void setTn(double tn) {
		this.tn = tn;
	}

	public void setTp(double tp) {
		this.tp = tp;
	}

	public double getTP(){
		return this.tp;
	}
	public double getFP(){
		return this.fp;
	}
	public double getTN(){
		return this.tn;
	}
	public double getFN(){
		return this.fn;
	}

	public double getMCC(){
		return ((tp*tn)-(fp*fn)) / Math.sqrt((tp+fp)*(tp+fn)*(tn+fp)*tn+fn);
	}

	public static double getMCC(double tp, double fp, double tn, double fn){
		return ((tp*tn)-(fp*fn)) / Math.sqrt((tp+fp)*(tp+fn)*(tn+fp)*tn+fn);
	}

}
